{$cleo .cs}

0000:

const
    CAR_HANDLE        = 11@
    tm_addres         = 14@
    object_handle     = 15@
END

//hook
0085: CAR_HANDLE = 0@ 
0AC6: tm_addres = label @CAR_handle offset
0A8C: write_memory tm_addres size 4 value CAR_HANDLE virtual_protect 0 //OF 


while true
    wait 0
    
    0AC6: tm_addres = label @CAR_handle offset                                                                        
    0A8d: CAR_HANDLE tm_addres  4  0                                            
    if 056E:   car CAR_HANDLE defined 
    then 
        goto @create_pickup
    else end_thread                                                             
    end                                                                         
end


:create_pickup
Model.Load(3060)                                                                                                                   
038B: load_requested_models                                                                                                            
Car.StorePos(CAR_HANDLE, 3@, 4@, 5@)                                                                                                          
object_handle = Object.Create(3060, 3@, 4@, 5@)                                                                                                   
Object.Angle(object_handle) = 90.0                                                                                                                
0681: attach_object object_handle to_car CAR_HANDLE with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0                                                                                                                                           
035D: set_object object_handle targetable 1                                                                                                        
071F: set_object object_handle health_to 99999                                                                                                    
Object.CollisionDetection(object_handle) = False                                                                                                  
08D2: object object_handle scale_model 0.0                                                                                                        
050E: set_object object_handle no_collision_with_car CAR_HANDLE                                                                                         
0750: set_object object_handle visibility 1                                                                                                        

while true
    wait 0 
    if OR 
        8471:   actor $PLAYER_ACTOR near_object_in_rectangle object_handle radius 50.0 50.0 sphere 0
        856E:   car CAR_HANDLE defined  
    then BREAK
    end
end

Object.Destroy(object_handle)
end_thread


:CAR_handle
hex
00 00 00 00
end

:object_handle
hex
00 00 00 00
end























         

